package com.zy.mapper;

import com.zy.entity.Shop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface ShopMapper {
    @Select("SELECT * FROM tb_shops")
    @Results({
        @Result(property = "id", column = "id"),
        @Result(property = "name", column = "name"),
        @Result(property = "url", column = "image_url"), // 映射 imageUrl
        @Result(property = "price", column = "price"),
        @Result(property = "contactPerson", column = "contact_person"),
        @Result(property = "contactPhone", column = "contact_number")
    })
    List<Shop> getAllShops();
}
